<?php
   @include_once("connect.php");

   $phone=$_POST["phone"];
        $sql="SELECT  phone from `userinfo` WHERE phone='$phone'";
        $result=mysqli_query($conn,$sql);
        // print_r($result);
        $obj=array();

        if($result){
             $item=mysqli_fetch_assoc($result);
              if(!$item){
                    $obj['status']=true;
                    $obj['msg']='可以使用的用户名';
                       
               }else{
                  $obj['status']=false;
                  $obj["msg"]='该用户名已被注册';
               }
        }else{
        $obj["status"] = false;
        $obj["msg"] = "sql语句有误";
        $obj["sql"] = $sql;
    }
  
        echo json_encode($obj);

?>


       
